function output = fn_cost_dep_app_i(D0i,R1,delta,D0,chi,~,~,~,~,phi,s_min,~,dist_d,d_min,d_max,s_star,s_hat,dist_s,prob)
% Early or late doesn't matter, so no need to do both

f_int_A  = @(s) fn_dcdd_dep(D0i,delta,R1,D0,chi,s,phi,dist_d,d_min,d_max).*dist_s.pdf(s);
f_int_B  = @(s) fn_dcdd_dep(D0i,delta,R1,D0,chi,s,phi,dist_d,d_min,d_max).*dist_s.pdf(s);

A_dep  = integral(f_int_A,s_min,s_hat);
B_dep  = integral(f_int_B,s_hat,s_star);

output  = A_dep + prob*B_dep;

end